home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 4: Demo 1
/
almathera_demo1.bin
/
sourcecode
/
dexion
/
demo lines 1.s
< prev
next >
Wrap
Text File
|
1995-03-17
|
3KB
|
219 lines
; the demo lines
; af soren gronbech
;
org $7f000
load $7f000
scr=$7a000
struc=$7d000
rastport=struc+100
;
setupsystem:
bsr getgfx
bsr cleanitdown
;
move.w #8000-1,d0
move.l #scr,a0
slet:
move.b #0,(a0)+
dbra d0,slet
move.l #scr,a0
move.l a0,struc+8
move.l struc,a0
moveq #1,d0
move.l #320,d1
move.l #200,d2
move.l gfxbase,a6
jsr -390(a6)
move.l #rastport,a1
jsr -198(a6)
move.l struc,rastport+4
move.l #copper0,newcop
bsr changecop
; - DEMO -
move=-240
draw=-246
setapen=-342
move.l #rastport,a1
move.w #2198,count
mainloop:
move.w #5000,d0
ause:
dbra d0,ause
clr.l d0
jsr setapen(a6)
clr.l d0
clr.l d1
move.w x0+38,d0
move.w y0+38,d1
jsr move(a6)
clr.l d0
clr.l d1
move.w x1+38,d0
move.w y1+38,d1
jsr draw(a6)
jsr copycor
move.l #1,d0
jsr setapen(a6)
jsr calcnyline
clr.l d0
clr.l d1
move.w x0,d0
move.w y0,d1
jsr move(a6)
clr.l d0
clr.l d1
move.w x1,d0
move.w y1,d1
jsr draw(a6)
btst #6,$bfe001
bne mainloop
jmp $fc0000
; - cor -
x0: blk.w 20,0
y0: blk.w 20,0
x1: dc.w 310
blk.w 19,0
y1: dc.w 0
blk.w 19,0
count: dc.w 0
copycor:
move.l #x0,a0
move.w #36,d0
qryk:
move.w 000(a0,d0.w),002(a0,d0.w)
move.w 040(a0,d0.w),042(a0,d0.w)
move.w 080(a0,d0.w),082(a0,d0.w)
move.w 120(a0,d0.w),122(a0,d0.w)
sub.w #2,d0
cmp.w #-2,d0
bne qryk
rts
;
x0r: dc.b 0
y0r: dc.b 0
x1r: dc.b 0
y1r: dc.b 0
;
speed=4
speed2: dc.w 0
;
calcnyline:
move.w #speed,d0
asr.w #1,d0
n0:
tst.b x0r
beq q0
sub.w #speed,x0
bra n1
q0:
add.w #speed,x0
n1:
tst.b y0r
beq q1
sub.w #speed,y0
bra n2
q1:
add.w #speed,y0
n2:
tst.b x1r
beq q2
sub.w d0,x1
bra n3
q2:
add.w d0,x1
n3:
tst.b y1r
beq q3
sub.w d0,y1
bra n4
q3:
add.w d0,y1
n4:
btst #15,x0
beq ok0
add.w #speed,x0
bchg #0,x0r
bra n5
ok0:
cmp.w #320,x0
bcs n5
sub.w #speed,x0
bchg #0,x0r
n5:
btst #15,x1
beq ok1
add.w #speed,x1
bchg #0,x1r
bra n6
ok1:
cmp.w #320,x1
bcs n6
sub.w #speed,x1
bchg #0,x1r
n6:
btst #15,y0
beq ok2
add.w #speed,y0
bchg #0,y0r
bra n7
ok2:
cmp.w #200,y0
bcs n7
sub.w #speed,y0
bchg #0,y0r
n7:
btst #15,y1
beq ok3
add.w #speed,y1
bchg #0,y1r
bra n8
ok3:
cmp.w #200,y1
bcs n8
sub.w #speed,y1
bchg #0,y1r
n8: rts
; - coppers -
copper0:
dc.w $0100,$1200
dc.w $008e,$2c81
dc.w $0090,$f4c1
dc.w $0092,$38
dc.w $0094,$d0
dc.w $0108,$0000
dc.w $010a,$0000
dc.w $00e0,$0007
dc.w $00e2,$a000
dc.w $0180,$0000
dc.w $0182,$0f33
dc.w $ffff,$fffe
; - gfx -
gfxbase: dc.l 0
gfxname: dc.b "graphics.library",0,0
getgfx:
move.l 4,a6
move.l #gfxname,a1
jsr -408(a6)
move.l d0,gfxbase
rts
; - change copper list -
newcop: dc.l 0
changecop:
move.l gfxbase,a0
move.l newcop,50(a0)
rts
forbid=-132
oldcopper: dc.l 0
cleanitdown:
move.l 4,a6
jsr -132(a6)
rts